Skip to main content

DigiLocker Fetch eAadhaar API

The following document highlights the details of the DigiLocker Fetch eAadhaar API.

API Description

Objective

The DigiLocker Fetch eAadhaar API retrieves the user's eAadhaar details from Digilocker.

InputOutput
A unique reference identifierThe eAadhaar details of the customer in a JSON response, including their name, date of birth, address, photo, and their gender

API URL

https://ind-verify.hyperverge.co/api/digilocker/eAadhaarDetails

API Endpoint

eAadhaarDetails

Overview

The DigiLocker Fetch eAadhaar API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.

Method - POST

Authentication

You need a unique pair of application ID ( appId ) and application key ( appKey ) from HyperVerge to verify your identity for accessing the API.

Headers

HeaderMandatory / OptionalDescriptionInput Format
content-type MandatoryThis parameter defines the media type for the request payloadapplication/json
appId MandatoryThe application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tabThis should be a unique value
appKey MandatoryThe application key shared by HyperVerge. You can find the details in the dashboard's credentials tabThis should be a unique value
transactionIdOptionalA unique identifier for tracking a user journeyThis should be both unique and easily associated with the user's journey in your application(s)

Inputs

The following table provides the details of the parameters required for the DigiLocker Fetch eAadhaar API's request body:

ParameterMandatory / OptionalTypeDescriptionInput FormatDefault Value
referenceIdMandatorystringThe unique reference identifierNot ApplicableNot Applicable
aadhaarFileMandatorystringThe parameter that fetches the customer's eAadhaar detailsyes / noNot Applicable
rawAddressFieldsOptionalstringThe parameter that controls address formatting in the response. When set to "yes", the API adds an addressFields object in the response with the user's address segregated into relevant fields. When set to "no", the response contains only the address field with the user's address as a single string valueyes / nono
returnYobOptionalstringThe parameter that controls whether year of birth (yob) is returned in the response. When set to "yes", the API adds a yob field in the response with the user's year of birth. When set to "no", the response contains only the dob field with the user's date of birth as received from DigiLocker
info
The format of Date of Birth in the response matches the eAadhaar format; either DD/MM/YYYY or year only (YYYY), depending on what is displayed in the eAadhaar.
yes / nono
returnFatherNameOptionalstringThe parameter that controls whether the father's name is returned in the response. When set to "yes", the API adds a fatherName field in the response with the user's father's nameyes / nono
signedImageOptionalstringThe parameter that controls whether a signed photo URL is returned in the response. When set to "yes", the API adds a signedPhotoFile field in the response with the user's S3 pre-signed URL photoyes / nono
useV2StorageLocationOptionalstringThe parameter that enables dashboard visibility and controls aadhaar file URL expiry. When set to "yes", you can view the data in the dashboard and the aadhaar file URL expiry will be set for three hoursyes / nono
blockMinorsOptionalstringThe parameter that controls whether minor accounts are blocked. When set to "yes", the API returns a 400 response denoting the digilocker account belongs to a minoryes / nono
returnCreatedTimeStampOptionalstringThe parameter that controls whether the created timestamp is returned in the response. When set to "yes", the API returns the epoch timestamp in milliseconds for the created timestamp of the aadhaar fileyes / nono
aadhaarFileGenerationChannelOptionalstringThe parameter that controls the formatting of the aadhaar file. Based on the values passed (default or cvl), the formatting of the aadhaar file changesdefault / cvldefault
returnUserConsentErrorOptionalstringThe parameter that controls whether a 400 error is returned when consent is not provided. When set to "yes", the API returns a 400 error in case consent is not provided by the user to access the Digilocker accountyes / nono
returnSummaryOptionalstringThe parameter that controls whether a summary key is returned in the response. When set to "yes", the API adds a summary key in the responseyes / nono

Request

The following code snippet demonstrates a standard curl request for the DigiLocker Fetch eAadhaar API:

curl --location --request POST 'https://ind-verify.hyperverge.co/api/digilocker/eAadhaarDetails' \
--header 'Content-Type: application/json' \
--header 'appID: <Enter_the_HyperVerge_appId>'\
--header 'appKey: <Enter_the_HyperVerge_appKey>'\
--header 'transactionID: <Enter_the_HyperVerge_transactionID>' \
--data-raw '{
"referenceId" : "<Reference_ID>",
"aadhaarFile" :"yes"
}'

Success Response

The following code snippet demonstrates a success response from the DigiLocker Fetch eAadhaar API:

{
"status": "success",
"statusCode": "200",
"result": {
"name": "<Name_of_the_User>",
"dob": "<Date_Of_Birth_from_eAadhaar>",
"address": "<Address_Of_The_User>",
"maskedAadhaarNumber": "<Masked_Aadhaar_Number>",
"photo": "<Base64_Image_Of_The_Users_Profile_Photo>",
"addressFields": {
"co": "<Care_Of_Field>",
"country": "<Country>",
"district": "<District>",
"subDistrict": "<Subdistrict>",
"postOffice": "<Post_Office>",
"house": "<House_Number>",
"locality": "<Locality>",
"pincode": "<Pincode>",
"state": "<State>",
"street": "<Street>",
"vtc": "<Village_Town_City>",
"landmark": "<Landmark>"
},
"gender": "<Gender>",
"aadhaarFile": "<Link to aadhaar file>",
"xmlAadhaarFile" : "<link to xml aadhaar file>",
"createdTimeStamp": "1737033755319", //returned when returnCreatedTimeStamp is enabled
"summary": {
"action": "pass",
"details": []
}
}
}

Success Response Details

The following table outlines the details of the success response from the DigiLocker Fetch eAadhaar API:

ParameterTypeDescription
statusstringThe status of the request
statusCodestringThe HTTP status code for the response
resultobjectThe JSON object containing the eAadhaar details
result.namestringThe name of the customer
result.dobstringThe date of birth of the customer
result.addressstringThe address of the customer
result.maskedAadhaarNumberstringThe masked Aadhaar number of the customer
result.photostringThe base64 string of the customer's profile photo
result.summaryobjectThe object containing summary information. This field is returned when returnSummary is set to "yes"
result.summary.actionstringThe action status in the summary
result.summary.detailsarrayThe array containing summary details
result.addressFieldsobjectThe object containing segregated address fields
result.addressFields.costringThe care of field in the address
result.addressFields.countrystringThe country in the address
result.addressFields.districtstringThe district in the address
result.addressFields.subDistrictstringThe subdistrict in the address
result.addressFields.postOfficestringThe post office in the address
result.addressFields.housestringThe house number in the address
result.addressFields.localitystringThe locality in the address
result.addressFields.pincodestringThe pincode in the address
result.addressFields.statestringThe state in the address
result.addressFields.streetstringThe street in the address
result.addressFields.vtcstringThe village, town, or city in the address
result.addressFields.landmarkstringThe landmark in the address
result.genderstringThe gender of the customer
result.aadhaarFilestringThe S3 URL for the Aadhaar file
result.xmlAadhaarFilestringThe link to the XML Aadhaar file
result.createdTimeStampstringThe epoch timestamp in milliseconds for the created timestamp of the aadhaar file. This field is returned when returnCreatedTimeStamp is set to "yes"

Error Responses

The following are some error responses from the DigiLocker Fetch eAadhaar API:

{
"status": "failure",
"statusCode": "400",
"error": {
"code": "ER_REQ_VALIDATE",
"message": "referenceId is required"
}
}
{
"status": "failure",
"statusCode": "422",
"error": {
"message": "Aadhaar data is not available for this user. Please perform Aadhaar eKYC again",
"code": "ER_AADHAAR_NOT_AVAILABLE"
}
}
{
"status": "failure",
"statusCode": "504",
"error": {
"code": "ER_DIGILOCKER_UNABLE_TO_FETCH_DATA",
"message": "Digilocker unable to fetch data from UIDAI.Please try starting the process again"
}
}

Error Response Details

A failure or error response contains a failure status with a relavant status code and error message.
The following table lists all error responses:

Status CodeError MessageError DescriptionError Resolution
400referenceId is requiredThe mandatory referenceId parameter is missing from the requestProvide valid referenceId in the request
400Please try verifying the refIdThe provided referenceId is invalidVerify and provide a valid referenceId
400user cancelled the transactionThe user cancelled the transaction during the DigiLocker authentication processPlease try again or contact the user
400consent not provided by user to access digilockerThe user rejected consent to access their DigiLocker accountPlease ensure user provides consent or try again
401Missing/Invalid credentialsThe request is either missing the mandatory appId and appKey combination or has invalid valuesProvide valid appId and appKey credentials in the request
401Session has expired.The user's DigiLocker session has expired. This error typically occurs in the following scenarios:
  • The DigiLocker consent flow was not completed properly before attempting to fetch Aadhaar details
  • The callback URL configuration is incorrect, preventing proper redirection and session establishment
  • Ensure the complete DigiLocker consent flow is followed before calling the Aadhaar details endpoint
  • Verify that the callback URL is configured correctly to enable proper redirection
  • If this error persists despite following the steps above, please contact our support team at support@hyperverge.co
422Aadhaar is not linked to the accountThe user's Aadhaar is not linked to their DigiLocker accountPlease ensure the user links their Aadhaar to DigiLocker
422Aadhaar data is not available for this user. Please perform Aadhaar eKYC againAadhaar data is unavailable for the userPlease perform Aadhaar eKYC again
500Something went wrongThere was an error with HyperVerge's serverPlease check the request headers or contact the HyperVerge team for resolution
504Error Connecting to digilocker. Please try again after sometime.DigiLocker service is unresponsive, unpublished, inactive, or has configuration/response/exception errorsPlease try again after sometime or contact the HyperVerge team
504Digilocker unable to fetch data from UIDAI.Please try starting the process againDigiLocker was unable to fetch data from UIDAIPlease try starting the process again
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: